package com.phone.exception;

/**
 * Created by tisen on 2017/8/3.
 */
public class LoginException extends Exception {
    public static final int PHONE_NOT_REGISTER = 1;
    public static final int ERROR_PHONE_OR_PASSWORD = 2;
    public static final int ERROR_USERNAME_OR_PASSWORD = 3;

    private String error_message = "login error";


    public LoginException(int type) {
        switch (type) {
            case PHONE_NOT_REGISTER:
                error_message = "phone not register";
                break;
            case ERROR_PHONE_OR_PASSWORD:
                error_message = "phone or password error";
                break;
            case ERROR_USERNAME_OR_PASSWORD:
                error_message = "username or password error";
                break;
            default:
                break;
        }
    }

    @Override
    public String getMessage() {
        return error_message;
    }

}
